package com.example.xunua_mymusic.utils;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class MySqliteHelper extends SQLiteOpenHelper {
    public MySqliteHelper(@Nullable Context context,int version) {
        super(context, "users", null, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql="create table user(_id integer primary key autoincrement not null,name varchar(20),password varchar(20),iphone varchar(50))";
        db.execSQL(sql);
        db.execSQL("insert into user values(1,'admin','admin','12345678910')");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
